package lab6part4;

/**
 * Title: TrafficSignalTest class for CSIS 235 Lab #6
 * Description: CS 235 Lab #6 - TrafficSignalTest
 *  This class is a simple tester for the class TrafficSignal.
 *
 * @author Nino & Hosch - this class is from the textbook.
 * @email  your.n.here@my.uwrf.edu
 * @date   October 10th 2012
 */

public class TrafficSignalTest {
	  
	  private TrafficSignal signal;      // the object to test
	  
	  /**
	   * Create a TrafficSignalTest
	   */
	  public TrafficSignalTest () {
	    // create a signal to test:
	    signal = new TrafficSignal();
	  }
	  
	  /**
	   * Run the test.
	   */
	  public void runTest () {
	    testInitialState();
	    testChange();
	  }
	  
	  /**
	   * Test the TrafficSignal's initial state.
	   */
	  private void testInitialState () {
	    System.out.println("testInitialState:");
	    System.out.println("Initial light: " + signal.light());
	  }
	  
	  /**
	   * Test the method change.
	   */
	  private void testChange () {
	    System.out.println("testChange:");
	    System.out.println("Starting light: " + signal.light());
	    signal.change();
	    System.out.println("After 1 change: " + signal.light());
	    signal.change();
	    System.out.println("After 2 changes: " + signal.light());
	    signal.change();
	    System.out.println("After 3 changes: " + signal.light());
	  }
	}